package misc;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Input_Handler {
	private BufferedReader _stdin;
	private StringTokenizer _st;
	
	public Input_Handler() {
		_stdin = new BufferedReader(new InputStreamReader(System.in));
		_st = new StringTokenizer("");
	}

	// Read next input-token as string.
	public String readString() throws Exception {
		while (!_st.hasMoreTokens())
			_st = new StringTokenizer(_stdin.readLine());
		return _st.nextToken();
	}

	// Read next input-token as integer.
	public int readInt() throws Exception {
		return Integer.parseInt(readString());
	}

	// Read next input-token as double.
	public double readDouble() throws Exception {
		return Double.parseDouble(readString());
	}
	
}
